#ifndef ECGFILTER_H
#define ECGFILTER_H
#include <QVector>

class EcgFilter
{
private:
    struct LP {
        float y1=0;
        float y2=0;
        QList<float> data;
        int ptr=0;
        LP(){
            data.fill(0, 30);
        }
    };
    struct HP {
        float y=0;
        QList<float> data;
        int ptr=0;
        HP(){
            data.fill(0, 130);
        }
    };
    struct BP{
        float f0;
        float fs;
        float BW;

        float b0, b1, b2;
        float a0, a1, a2;
        float x1, x2;
        float y1, y2;
    };
    LP lpData;
    HP hpData;
    BP bpData;
public:
    EcgFilter();
    float lp(float datum);
    float hp(float datum);
    void initBp(float f0, float fs, float BW);
    float bp(float input);
};

#endif // ECGFILTER_H
